package com.zpkj.portal.utils;

import java.util.Random;

/**
 * 随机生成位数工具类
 * @author xc
 */
public class RandomUtils {

//	public static void main(String[] args) {
//		System.out.println(getRandomNum());
//	}
	
	/**
	 * 获取随机数
	 * @param start 开始数字
	 * @param end 结束数字
	 * @auth wck
	 * @return
	 */
	public static int getRandomNum(int start, int end) {
		Random random = new Random();
		int d = random.nextInt(start + 1);
		return end - start + d;
	}
	
	/**
	 * 随机数50-150
	 */
	public static int getRandomNum(){
		Random random = new Random();
		int x = random.nextInt(100);
		return x+50;
	}
	
	/**
	 * 手机注册六位校验码生成
	 */
	public static String getRandomNum6(){
		Random random = new Random();
		int x = random.nextInt(899999);
		return x+100000+"";
	}
	
	/**
	 * 手机注册四位校验码生成
	 */
	public static String getRandomNum4(){
		Random random = new Random();
		int x = random.nextInt(8999);
		return x+1000+"";
	}
	
}
